package com.acme.service.bank;

import java.io.FileNotFoundException;
import java.io.IOException;

import com.acme.domain.bank.Bank;
import com.acme.domain.client.Client;
import com.acme.exceptions.ClientAlreadyExistsException;
import com.acme.exceptions.ClientCountLimitException;

public class BankService {
	
	public static void addClient(Bank bank,Client client) throws ClientAlreadyExistsException, ClientCountLimitException{
		bank.addClient(client);
	}
	public static void printMaximumAmountToWithdraw(Bank bank) throws ClientCountLimitException{
		for (int i=1;i<=bank.getNumberOfClients();i++){
			System.out.println(bank.getClient(i).getAccount().maximumAmountToWithdraw());
		}
	}
	public static void loadBank(final Bank bank, final String path) throws FileNotFoundException, IOException{
		BankDataLoaderService.load(bank, path);
	}
	public static void saveBank(final Bank bank,final String path) throws FileNotFoundException{
		BankDataSaverService.save(bank, path);
	}
}
